<template>
  <text
    class="iconfont iconfont-tuichu"
    :style="{ color: color, fontSize: size + 'rpx' }"
    @click="logout"
  ></text>
</template>

<script>
// 退出到登录页按钮封装
export default {
  name: 'LogoutButton',
  props: {
    color: {
      type: String,
      default: '#fff',
    },
    size: {
      type: Number,
      default: 36,
    },
  },
  data() {
    return {};
  },
  methods: {
    logout() {
      uni.removeStorageSync('userToken');
      uni.reLaunch({
        url: '/pages/login/login',
      });
    },
  },
};
</script>

<style lang="scss"></style>
